<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<head>
<style type="text/css">
	#bgMaster
	    {
	        display:none;    
	        position:fixed;    
	        _position:absolute;   
	        height:100%;    
	        width:100%;    
	        top:0;    
	        left:0;    
	        background:#000000;    
	        border:1px solid #cecece;    
	        z-index:100;    
	    }  
	    
	    .delete2 {
      display: block;
      color: white;

      width: 20px;
      height: 20px;
      top: 0;
      right: 13px;
      position: absolute;
      text-align: center;
      line-height: 20px; }  
</style>
<jsp:include page="../common/common.jsp" />
<link rel="stylesheet" type="text/css"
	href="${path}/assets/plugins/select2/select2.css" />
<link rel="stylesheet" type="text/css"
	href="${path}/assets/plugins/select2/select2-metronic.css" />
</head>


<body class="page-header-fixed">
	<script type="text/javascript" src="${path }/layer/layer.js"></script>
	<!-- BEGIN HEADER -->
	<jsp:include page="../common/header.jsp" />
	<div class="clearfix"></div>
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<div class="page-sidebar-wrapper"><jsp:include
				page="../common/menu.jsp" /></div>
		<div class="page-content-wrapper">
			<div class="page-content">
				<!-- BEGIN PAGE CONTENT-->
				<div class="row">
					<div class="col-md-12">
						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box purple">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-file-text-o"></i> 直播间列表
								</div>
								<div class="tools">
									<div id="actions" class="actions">
										<a href="${path}/live/edit" class="btn green"><i
											class="fa fa-plus">创建直播间</i></a>
									</div>
								</div>
							</div>
							<div class="portlet-body">
								<form id="formQuery" class="form-horizontal"
									action="${path}/live/list">
									<div class="form-body">
										<div class="form-group">
											<label class="col-md-1 control-label">直播名称:</label>
											<div class="col-md-2">
												<input type="text" id="name" name="name"
													class="form-control" />
											</div>
											<label class="col-md-1 control-label">创建时间:</label>
											<div class="col-md-4">
												<div
													class="input-group input-large date-picker input-daterange"
													data-date-format="yyyy-mm-dd">
													<input type="text" class="form-control" id="fromDate"
														name="fromDate" value="${fromDate}" readonly="readonly"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
													<span class="input-group-addon">to</span> <input
														type="text" class="form-control" id="toDate" name="toDate"
														value="${toDate}" readonly="readonly"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
												</div>
											</div>
										
												<label class="col-md-1 control-label">播放状态:</label>
												<div class="col-md-2"  style="width: 170px;">
													<select name="status" id="status" class="form-control">
														<option value="">请选择</option>
														<option value="0">播放片花</option>
														<option value="1">播放直播</option>
														<option value="2">播放回播</option>
													</select>
												</div><div class="col-md-1">
												<button type="button" class="btn green"
													onclick="getliveList()">查询</button>
											</div>
											</div>
									</div>
								</form>
								<table class="table table-striped table-bordered table-hover"id="liveList"></table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<input type="hidden" id="username" name="username" value="${user.username}"> 
		<input type="hidden" id="roleid" name="roleid" value="${roleid}">
		<input type="hidden" id="isshow" name="isshow">
	</div>
	<!-- ************遮罩层************** -->     
	<div id="ajax-modal" class="modal fade bs-modal-lg" tabindex="-1" role="dialog"
                                 data-keyboard="false"  style="margin-top: 230px;width: 950px;margin-left: 450px">
                          
                                       
                                        <div class="modal-body">
                                            <div class="row">
                                                <div class="col-md-8">
                                                    <div class="portlet box purple ">
                                                        <div class="portlet-title">
                                                            <div class="caption">
                                                                <i class="fa fa-reorder"></i> 基本信息
                                                                   <a class='delete2' href='#'  data-dismiss="modal">&times;</a>
                                                            </div>
                                                        </div>
                                                        <div class="portlet-body form">
                                                            <form id="formDetail" class="form-horizontal">
                                                                <div class="form-body">
                                                                    <div class="form-group">
                                                                        <label class="col-md-3 control-label">直播名称：</label>

                                                                        <div class="col-md-8">
                                                                            <input type="text" id="lid"
                                                                                 
                                                                                   class="form-control"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-md-3 control-label">电脑端地址：</label>

                                                                        <div class="col-md-8">
                                                                            <input type="text" id="liveurl"
                                                                                   name="liveurl"
                                                                                   class="form-control"   style="width: 80%;float: left;"/>
                                                                               
                                                               	 <button type="button" class="btn btn-primary"   style="float: right;" onclick="copyUrl()">复制</button>
                                                                        </div>
                                                                   </div>
                                                                   
                                                                 <div class="form-group">
                                                                        <label class="col-md-3 control-label">手机端地址：</label>

                                                                        <div class="col-md-8">
                                                                            <input type="text" id="wapurl"
                                                                                   name="wapurl"
                                                                                   class="form-control"   style="width: 80%;float: left;"/>
                                                                               
                                                               	 <button type="button" class="btn btn-primary"   style="float: right;" onclick="copyUrl1()">复制</button>
                                                                        </div>
                                                                   </div>
                                                                </div>
                                                            </form>
                                                        </div>
                                                    </div>
                                                </div>
                                            
                                            </div>
                                        </div>
                                       <!-- <div class="modal-footer">
                                            <button type="button" class="btn default" data-dismiss="modal">关闭</button>
                                        </div> --> 
                             
                            </div>
                                                  
    <!-- ************遮罩层************** -->     
	<div id="dbajax-modal" class="modal fade bs-modal-lg" tabindex="-1" role="dialog"
                                 data-keyboard="false"  style="margin-top: 230px;width: 950px;margin-left: 450px">
                               
                     
                           
                                  <!--       <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"></button>
                                            <h4 class="modal-title">详细信息</h4>
                                        </div> -->
                                        <div class="modal-body" >
                                            <div class="row">
                                                <div class="col-md-8">
                                                    <div class="portlet box purple ">
                                                        <div class="portlet-title">
                                                            <div class="caption">
                                                                <i class="fa fa-reorder" ></i> 基本信息
                                                                <a class='delete2' href='#'  data-dismiss="modal">&times;</a>
                                                   
                                                            </div>
                                                        </div>
                                                        <div class="portlet-body form">
                                                            <form id="formDetail" class="form-horizontal">
                                                                <div class="form-body">
                                                                    <div class="form-group">
                                                                        <label class="col-md-3 control-label">直播名称：</label>

                                                                        <div class="col-md-8">
                                                                            <input type="text" id="dlid"
                                                                                 
                                                                                   class="form-control"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-md-3 control-label">导播地址：</label>

                                                                        <div class="col-md-8">
                                                                            <input type="text" id="daoliveurl"
                                                                                   name="daoliveurl"
                                                                                   class="form-control"   style="width: 80%;float: left;"/>
                                                                               
                                                               	 <button type="button" class="btn btn-primary"   style="float: right;" onclick="copyUrl3()">复制</button>
                                                                        </div>
                                                                   </div>
                                                             
                                                                </div>
                                                            </form>
                                                        </div>
                                                    </div>
                                                </div>
                                            
                                            </div>
                                        </div>
                                       <!--   <div class="modal-footer">
                                            <button type="button" class="btn default" data-dismiss="modal">关闭</button>
                                        </div>-->
                                    </div>
                          
    <div id="bgMaster" style="z-index: 100" onclick="Cancelpops()"></div>
    <!-- ************遮罩层************** -->
    
    <!-- ************二维码层************** -->                           
    <div id='images' style="display: none; z-index: 300; height: 300px; width: 300px; background-color: #FFFFFF;">   
         <img id="imgs" alt="" src="">   
    </div>
    <div id="bgMaster" style="z-index: 100"></div>
    <!-- ************二维码层************** -->
	<jsp:include page="../common/footer.jsp" />
<script type="text/javascript" src="${path}/assets/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="${path}/operate/js/live.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/calendar/WdatePicker.js"></script>

<script>
var msg = '${msg}';
$(function() {
	if (msg)
		App.bubble(200, msg);
	getliveList();
});
////********************************************************
//初始化：是否开启DIV弹出窗口功能 0 表示开启; 1 表示不开启;
var popupStatus = 0;
//使用Jquery加载弹窗
function loadPopup() {
    //仅在开启标志popupStatus为0的情况下加载   
    if (popupStatus == 0) {
        $("#bgMaster").css({
            "opacity": "0.5"
        });
        $("#bgMaster").fadeIn("slow");
        // $("#popupContact").fadeIn("slow");
        popupStatus = 1;
    }
}
//使用Jquery去除弹窗效果  
function disablePopup() {
    //仅在开启标志popupStatus为1的情况下去除 
    if (popupStatus == 1) {
        //$("#"+showdiv).fadeOut("slow");
        $("#bgMaster").fadeOut("slow");
        popupStatus = 0;
    }
}   
 
//将弹出窗口定位在屏幕的中央 
function centerPopup(showdiv) {
    //获取系统变量 
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var popupHeight = $("#" + showdiv).height();
    var popupWidth = $("#" + showdiv).width();
    //居中设置
    $("#" + showdiv).css({
        "position": "absolute",
        "top": windowHeight / 2 - popupHeight / 2,
        "left": windowWidth / 2 - popupWidth / 2
    });
    
    //以下代码仅在IE6下有效
    $("#bgMaster").css({
        "height": windowHeight
    });
} 

function onchangEvt(obj) {
    //var menus = document.getElementByIdx_x('province');
    var cc = obj.options[obj.selectedIndex].value;
    InitData_City(cc);
}

//弹出发布框
function ReleasePop() {
    try {
        loadPopup();
        centerPopup('aasp');
        $("#aasp").show();
    }
    catch (e) {
        alert(e.message);
    }
}
//取消弹出框
function Cancelpop() {
    disablePopup();
    $("#aasp").hide();
    Refresh();
}

//二维码弹出框
function ReleasePops() {
    try {
        loadPopup();
        centerPopup('images');
        $("#images").show();
    }
    catch (e) {
        alert(e.message);
    }
}

//二维码取消弹出框
function Cancelpops() {
    disablePopup();
    $("#images").hide();
    Refresh();
}

/*InitData();
function InitData() {
    try {
        $.get("ajax/zixun.ashx?types=province&dt=" + new Date().getTime(), function(data) { ProcessJson(data); });
    }
    catch (e) {
        throw (e.message);
    }
}*/


/*function InitData_City(provinceCode) {
    try {
        $.get('ajax/zixun.ashx?types=City&province_code=' + provinceCode + '&dt=' + new Date().getTime(), function(data) { ProcessJson_city(data); });
    }
    catch (e) {
        throw (e.message);
    }
}*/
function copyUrl(){
	var url=document.getElementById("liveurl");//input的ID值 ;
	    url.select(); // 选择对象
	    document.execCommand("Copy"); // 执行浏览器复制命令
	alert("已复制好，可贴粘。");
} 
function copyUrl1(){
	var url=document.getElementById("wapurl");//input的ID值 ;
	    url.select(); // 选择对象
	    document.execCommand("Copy"); // 执行浏览器复制命令
	alert("已复制好，可贴粘。");
} 
function copyUrl3(){
	var url=document.getElementById("daoliveurl");//input的ID值 ;
	    url.select(); // 选择对象
	    document.execCommand("Copy"); // 执行浏览器复制命令
	alert("已复制好，可贴粘。");
} 

</script>
</body>
<!-- END BODY -->
</html>